package com.cg.controller;

import com.cg.client.SystemClient;
import com.cg.dto.DictionaryDto;
import com.cg.dto.DictionaryPageDto;
import com.cg.dto.Result;
import com.cg.entity.DictionaryType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName DepartTypeController
 * @Description TODO
 * @Author CG
 * @Date 2023/12/1 10:42
 **/
@RestController
@RequestMapping("/type")
public class DepartTypeController {


    @Resource
    private SystemClient systemClient;

    /**
     * 查询全部Type
     * @return
     */
    @PostMapping("/queryTypeAll")
    public Result<List<DictionaryType>> queryTypeAll(){
        return systemClient.queryTypeAll();
    }


    /**
     * 新增
     */
    @PostMapping("/createDictionaryType")
    public Result createDictionaryType(DictionaryDto dictionaryDto){
        return systemClient.createDictionaryType(dictionaryDto);
    }


    /**
     * 查询数据字典表
     */
    @PostMapping("/queryDictionary")
    public Result<Map<String,Object>> queryDictionary(DictionaryPageDto dictionaryPageDto){
        return systemClient.queryDictionary(dictionaryPageDto);
    }
}
